package com.wipz.eoa.iphone.myworkmanagent.mywork.myworktype;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.wipz.eoa.iphone.BaseAction;

/**
 * 委托类型控制类
 * @author 张涛
 * @date 2012-2-6
 */

public class WorkTypeAction extends BaseAction {
	
	private static final long serialVersionUID = 1L;
	private IWorkTypeService workTypeService;
	private Object view;
	private List list;

	public Object getView() {
		return view;
	}

	public void setView(Object view) {
		this.view = view;
	}

	
	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}

	public void setWorkTypeService(IWorkTypeService workTypeService) {
		this.workTypeService = workTypeService;
	}
	

	/**
	 * 新增or更新
	 * author：张涛
	 * date：2012-2-6
	 * time：下午02:51:12
	 * return：String
	 */
	@SuppressWarnings("unchecked")
	/*public String addOrUpdate(){
		Map params = new HashMap();
		params = this.getRequest().getParameterMap();
		obj = workTypeService.addOrUpdate(params);
		return SUCCESS;
	}*/
	
	/**
	 * 查询所有
	 * author：张涛
	 * date：2012-2-6
	 * time：下午03:04:15
	 * return：String
	 */
	public String list(){
		Map params = new HashMap();
		params.put("sort", this.getRequest().getParameter("sort"));
		params.put("order", this.getRequest().getParameter("order"));
		list = workTypeService.queryAll(params);
		return SUCCESS;
	}
	
	/**
	 * 删除
	 * author：张涛
	 * date：2012-2-6
	 * time：下午03:18:10
	 * return：String
	 */
/*	public String delete(){
		Map params = this.getRequest().getParameterMap();
		obj = workTypeService.delete(params);
		return SUCCESS;
	}*/
	
	/**
	 * 查看详细信息
	 * author：张涛
	 * date：2012-2-6
	 * time：下午05:08:10
	 * return：String
	 */
	@SuppressWarnings("unchecked")
	public String view(){
		Map params = new HashMap();
		params.put("ID", this.getRequest().getParameter("id"));
		view = workTypeService.view(params);
		return SUCCESS;
		
	}
}
